Set fso=Wscript.CreateObject("Scripting.FileSystemObject") 
Set shell = CreateObject("WScript.Shell")
orchardSrcDir=shell.ExpandEnvironmentStrings("%OrchardSrc%")

Function Traversal(dir)
    Set flr=fso.GetFolder(dir)
    Set files=flr.Files
    findStr1="[assembly: SecurityTransparent]"
    findStr2=Replace(findStr1," ","")
    replaceStr="[assembly: AllowPartiallyTrustedCallers()] [assembly: SecurityRules(SecurityRuleSet.Level1, SkipVerificationInFullTrust = true)]"

    For Each file In files
        If Lcase(file.Name)="assemblyinfo.cs" Then  
            Set readStream=fso.OpenTextFile(file)   
               
            Do While readStream.AtEndOfStream=false
                d=file.DateLastModified
                allText=readStream.ReadAll   
               
                If(InStr(allText,findStr1) > 0 ) Then             
                    newStr=Replace(allText,findStr1, replaceStr)         
                    readStream.Close()          
                ElseIf(InStr(allText,findStr2) > 0) Then            
                    newStr=Replace(alltext,findStr2, replaceStr)                  
                    readStream.Close()          
                    Else 
                        readStream.Close() 
                        Exit Do
                End If   
                            
                Set writeStream=fso.OpenTextFile(file, 2, true) 
                writeStream.Write newStr 
                d2=file.DateLastModified
                If d2>=d Then 
                    Exit Do  
                End If         
            Loop   

        End If
    Next

    Set fs=flr.SubFolders
    For Each f In fs
        Traversal(f.Path)
    Next
End Function

Traversal(orchardSrcDir)
Wscript.quit 